<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="b2RevoluteJointDef,Box2D.Dynamics.Joints.b2RevoluteJointDef,enableLimit,enableMotor,localAnchorA,localAnchorB,lowerAngle,maxMotorTorque,motorSpeed,referenceAngle,upperAngle,Initialize" name="keywords">
<title>Box2D.Dynamics.Joints.b2RevoluteJointDef</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'b2RevoluteJointDef - Box2DFlash Documentation';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Box2DFlash Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?Box2D/Dynamics/Joints/b2RevoluteJointDef.html&amp;Box2D/Dynamics/Joints/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;b2RevoluteJointDef</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class b2RevoluteJointDef"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">Box2D.Dynamics.Joints</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class b2RevoluteJointDef</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">b2RevoluteJointDef <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../images/inherit-arrow.gif"> <a href="b2JointDef.html">b2JointDef</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Source</td><td><a href="http://box2dflash.svn.sourceforge.net/viewvc/box2dflash/Source/Box2D/Dynamics/Joints/b2RevoluteJointDef.as">b2RevoluteJointDef.as</a></td>
</tr>
</table>
<p></p>
Revolute joint definition. This requires defining an
anchor point where the bodies are joined. The definition
uses local anchor points so that the initial configuration
can violate the constraint slightly. You also need to
specify the initial relative angle for joint limits. This
helps when saving and loading a game.
The local anchor points are measured from the body's origin
rather than the center of mass because:
1. you might not know where the center of mass will be.
2. if you add/remove shapes from a body and recompute the mass,
the joints will be broken.
<p></p>
<p>
<span class="classHeaderTableLabel">See also</span>
</p>
<div class="seeAlso">
<a href="b2RevoluteJoint.html" target="">b2RevoluteJoint</a>
</div>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<div class="showHideLinks">
<div class="hideInheritedProperty" id="hideInheritedProperty">
<a onclick="javascript:setInheritedVisible(false,'Property');" href="#propertySummary" class="showHideLink"><img src="../../../images/expanded.gif" class="showHideLinkImage"> Hide Inherited Public Properties</a>
</div>
<div class="showInheritedProperty" id="showInheritedProperty">
<a onclick="javascript:setInheritedVisible(true,'Property');" href="#propertySummary" class="showHideLink"><img src="../../../images/collapsed.gif" class="showHideLinkImage"> Show Inherited Public Properties</a>
</div>
</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="b2JointDef.html#bodyA">bodyA</a> : <a href="../../Dynamics/b2Body.html">b2Body</a>
<div class="summaryTableDescription">
 The first attached body.</div>
</td><td class="summaryTableOwnerCol"><a href="b2JointDef.html">b2JointDef</a></td>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="b2JointDef.html#bodyB">bodyB</a> : <a href="../../Dynamics/b2Body.html">b2Body</a>
<div class="summaryTableDescription">
 The second attached body.</div>
</td><td class="summaryTableOwnerCol"><a href="b2JointDef.html">b2JointDef</a></td>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="b2JointDef.html#collideConnected">collideConnected</a> : Boolean<div class="summaryTableDescription">
 Set this flag to true if the attached bodies should collide.</div>
</td><td class="summaryTableOwnerCol"><a href="b2JointDef.html">b2JointDef</a></td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#enableLimit">enableLimit</a> : Boolean<div class="summaryTableDescription">
 A flag to enable joint limits.</div>
</td><td class="summaryTableOwnerCol">b2RevoluteJointDef</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#enableMotor">enableMotor</a> : Boolean<div class="summaryTableDescription">
 A flag to enable the joint motor.</div>
</td><td class="summaryTableOwnerCol">b2RevoluteJointDef</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#localAnchorA">localAnchorA</a> : <a href="../../Common/Math/b2Vec2.html">b2Vec2</a>
<div class="summaryTableDescription">
 The local anchor point relative to bodyA's origin.</div>
</td><td class="summaryTableOwnerCol">b2RevoluteJointDef</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#localAnchorB">localAnchorB</a> : <a href="../../Common/Math/b2Vec2.html">b2Vec2</a>
<div class="summaryTableDescription">
 The local anchor point relative to bodyB's origin.</div>
</td><td class="summaryTableOwnerCol">b2RevoluteJointDef</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#lowerAngle">lowerAngle</a> : Number<div class="summaryTableDescription">
 The lower angle for the joint limit (radians).</div>
</td><td class="summaryTableOwnerCol">b2RevoluteJointDef</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#maxMotorTorque">maxMotorTorque</a> : Number<div class="summaryTableDescription">
 The maximum motor torque used to achieve the desired motor speed.</div>
</td><td class="summaryTableOwnerCol">b2RevoluteJointDef</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#motorSpeed">motorSpeed</a> : Number<div class="summaryTableDescription">
 The desired motor speed.</div>
</td><td class="summaryTableOwnerCol">b2RevoluteJointDef</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#referenceAngle">referenceAngle</a> : Number<div class="summaryTableDescription">
 The bodyB angle minus bodyA angle in the reference state (radians).</div>
</td><td class="summaryTableOwnerCol">b2RevoluteJointDef</td>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="b2JointDef.html#type">type</a> : int<div class="summaryTableDescription">
 The joint type is set automatically for concrete joint types.</div>
</td><td class="summaryTableOwnerCol"><a href="b2JointDef.html">b2JointDef</a></td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#upperAngle">upperAngle</a> : Number<div class="summaryTableDescription">
 The upper angle for the joint limit (radians).</div>
</td><td class="summaryTableOwnerCol">b2RevoluteJointDef</td>
</tr>
<tr class="hideInheritedProperty">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol"><img class="inheritedSummaryImage" title="Inherited" alt="Inherited" src="../../../images/inheritedSummary.gif"></td><td class="summaryTableSignatureCol"><a class="signatureLink" href="b2JointDef.html#userData">userData</a> : *<div class="summaryTableDescription">
 Use this to attach application specific data to your joints.</div>
</td><td class="summaryTableOwnerCol"><a href="b2JointDef.html">b2JointDef</a></td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#b2RevoluteJointDef()">b2RevoluteJointDef</a>()</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">b2RevoluteJointDef</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#Initialize()">Initialize</a>(bA:<a href="../b2Body.html">b2Body</a>, bB:<a href="../b2Body.html">b2Body</a>, anchor:<a href="../../Common/Math/b2Vec2.html">b2Vec2</a>):void</div>
<div class="summaryTableDescription">
 Initialize the bodies, anchors, and reference angle using the world
 anchor.</div>
</td><td class="summaryTableOwnerCol">b2RevoluteJointDef</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="enableLimit"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">enableLimit</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public var enableLimit:Boolean</code><p>
 A flag to enable joint limits.
 </p></div>
<a name="enableMotor"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">enableMotor</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var enableMotor:Boolean</code><p>
 A flag to enable the joint motor.
 </p></div>
<a name="localAnchorA"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">localAnchorA</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var localAnchorA:<a href="../../Common/Math/b2Vec2.html">b2Vec2</a></code><p>
 The local anchor point relative to bodyA's origin.
 </p></div>
<a name="localAnchorB"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">localAnchorB</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var localAnchorB:<a href="../../Common/Math/b2Vec2.html">b2Vec2</a></code><p>
 The local anchor point relative to bodyB's origin.
 </p></div>
<a name="lowerAngle"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lowerAngle</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var lowerAngle:Number</code><p>
 The lower angle for the joint limit (radians).
 </p></div>
<a name="maxMotorTorque"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">maxMotorTorque</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var maxMotorTorque:Number</code><p>
 The maximum motor torque used to achieve the desired motor speed.
 Usually in N-m.
 </p></div>
<a name="motorSpeed"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">motorSpeed</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var motorSpeed:Number</code><p>
 The desired motor speed. Usually in radians per second.
 </p></div>
<a name="referenceAngle"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">referenceAngle</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var referenceAngle:Number</code><p>
 The bodyB angle minus bodyA angle in the reference state (radians).
 </p></div>
<a name="upperAngle"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">upperAngle</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var upperAngle:Number</code><p>
 The upper angle for the joint limit (radians).
 </p></div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="b2RevoluteJointDef()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">b2RevoluteJointDef</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function b2RevoluteJointDef()</code>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="Initialize()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Initialize</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function Initialize(bA:<a href="../b2Body.html">b2Body</a>, bB:<a href="../b2Body.html">b2Body</a>, anchor:<a href="../../Common/Math/b2Vec2.html">b2Vec2</a>):void</code><p>
 Initialize the bodies, anchors, and reference angle using the world
 anchor.
 </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">bA</span>:<a href="../b2Body.html">b2Body</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">bB</span>:<a href="../b2Body.html">b2Body</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">anchor</span>:<a href="../../Common/Math/b2Vec2.html">b2Vec2</a></code></td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">Box2DFlash 2.1a</center>
</div>
</body>
</html>
<!--Box2DFlash 2.1a-->
